message(STATUS "Configuring third party libraries")

if(TASK_MANAGER_BUILD_TESTS)
  include(ResolveGTest)
endif()

# Attempt to find threads library
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# Add required unix libraries
list(APPEND EXTERNAL_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})

# Expose required variables to parent scope
set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} PARENT_SCOPE)
set(EXTERNAL_LIBRARY_DIRS ${EXTERNAL_LIBRARY_DIRS} PARENT_SCOPE)
set(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES} PARENT_SCOPE)
set(EXTERNAL_DEPENDENCIES ${EXTERNAL_DEPENDENCIES} PARENT_SCOPE)

set(EXTERNAL_TEST_INCLUDE_DIRS ${EXTERNAL_TEST_INCLUDE_DIRS} PARENT_SCOPE)
set(EXTERNAL_TEST_LIBRARY_DIRS ${EXTERNAL_TEST_LIBRARY_DIRS} PARENT_SCOPE)
set(EXTERNAL_TEST_LIBRARIES ${EXTERNAL_TEST_LIBRARIES} PARENT_SCOPE)
set(EXTERNAL_TEST_DEPENDENCIES ${EXTERNAL_TEST_DEPENDENCIES} PARENT_SCOPE)
